package cglib;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @Author:zimmor
 * @Date: 2021/3/25 12:23
 * @Description
 * @version: 1.0.0
 */

public class CglibMethodInterceptor implements MethodInterceptor {
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        System.out.println("代理入场");
//        return methodProxy.invokeSuper(o,objects);
        System.out.println("method.getName() = " + method.getName());
        System.out.println("objects = " + objects.toString());
        return methodProxy.invokeSuper(o,objects);
    }
}
